// 导入axios.js工具包
import instance from "@/utils/axios.js";

// 1.查询文章分类
function getArticleCategory(){
    return instance({
        url:'/admin/category/list',
        method:'get'
    })
}

// 2.新增文章分类
function addArticleCategory({name,slug}){
    return instance({
        url:'/admin/category/add',
        method:'post',
        data:{name,slug}
    })
}

// 3.编辑文章分类
function editArticleCategory({id,name,slug}){
    return instance({
        url:'/admin/category/edit',
        method:'post',
        data:{id,name,slug}
    })
}

// 4.删除文章分类
function deleteArticleCategory(id){
    return instance({
        url:'/admin/category/delete',
        method:'post',
        data:{id}
    })
}

// 导出接口
export { 
    getArticleCategory,
    addArticleCategory,
    editArticleCategory,
    deleteArticleCategory
 }